/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bice.backbean;

import com.bice.entity.User;
import java.io.Serializable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Yeni
 */
@SessionScoped
@ManagedBean
public class SessionBean implements Serializable {
    
    private User user;

    public SessionBean() {
        Logger.getLogger(SessionBean.class.getName()).log(Level.INFO, "Init session bean");
    }

    /**
     * @return the user
     */
    public User getUser() {
        return user;
    }

    /**
     * @param user the user to set
     */
    public void setUser(User user) {
        this.user = user;
    }
    
    /**
     * @return is logged
     */
    public boolean isLogged() {
        return user != null;
    }
    
    /**
     * Disconnect user
     */
    public void disconnect() {
        user = null;
    }

}